<?php

/**
 * 系统默认主页(登录页)
 */
Route::get('/', ['as'=>'system.welcome','uses' =>"System\\UserController@loginPage"]);
Route::get('/story',['as' =>'system.story', 'uses' =>'System\\UserController@story']); //我们的故事
Route::get('/ceremony',['as' =>'system.ceremony', 'uses' =>'System\\UserController@ceremony']); //仪式
Route::get('/albums',['as' =>'system.albums', 'uses' =>'System\\UserController@albums']); //相册
Route::any('/contact_page',['as'=>'system.contactPage','uses'=>'System\\UserController@contactPage']); //联系我们
Route::any('/contact',['as'=>'system.contact','uses'=>'System\\UserController@contact']); //联系我们

/**
 * 通用功能路由组
 */
Route::group(['namespace' => 'Coms', 'prefix' => 'coms'], function () {

    //后台登录验证码
    Route::get('/login-code', ['as' => 'coms.login-code', 'uses' => 'ComsController@loginCode']);
    Route::get('/user-code', ['as' => 'coms.user-code', 'uses' => 'ComsController@userCode']);
});

/**
 * 后台登录系统路由
 */
Route::group(['namespace' => 'Admin', 'prefix' => 'root'], function () {

    //后台登录界面
    Route::get('/login-page', ['as' => 'admin.login-page', 'uses' => 'LoginController@loginPage']);
    Route::any('/login-act', ['as' => 'admin.login-act', 'uses' => 'LoginController@loginAct']);
    Route::get('/login-exit', ['as' => 'admin.login-exit', 'uses' => 'LoginController@exitAct']);

    //权限过滤后台管理界面(需管理员登陆才可访问的理由)
    Route::group(['prefix' => 'auth', 'middleware' => ['auth_admin']], function () {

        Route::get('/welcome', ['as' => 'admin.welcome', 'uses' => 'SettingController@welcomePage']);
        Route::get('/setting', ['as' => 'admin.setting', 'uses' => 'SettingController@settingPage']);
        Route::any('/setting-save', ['as' => 'admin.setting.save', 'uses' => 'SettingController@settingSave']);
        Route::any('/basic-setting', ['as' => 'admin.basic.setting', 'uses' => 'SettingController@basicSetPage']);
        Route::any('/basic-save', ['as' => 'admin.basic.save', 'uses' => 'SettingController@basicSave']);

        //会员咨询
        Route::any('/feedback/{flag?}/{index?}', ['as' => 'admin.feedback', 'uses' => 'ContentController@feedbackPage']);
        Route::any('/feed-edit/{id}/{index?}', ['as' => 'admin.feedback.edit', 'uses' => 'ContentController@feedbackEditPage']);
        Route::any('/feed-reply/{id}', ['as' => 'admin.feedback.reply', 'uses' => 'ContentController@feedbackReply']);
        Route::any('/feed-del/{id}', ['as' => 'admin.feedback.del', 'uses' => 'ContentController@feedbackDel']);

        //页面组成
        Route::any('/frag/{index?}',['as'=>'admin.frag', 'uses'=>'ContentController@fragPage']);
        Route::any('/frag-edit/{id?}',['as'=>'admin.frag.edit', 'uses'=>'ContentController@fragEditPage']);
        Route::any('/frag-save/{id?}',['as'=>'admin.frag.save', 'uses'=>'ContentController@fragSave']);
        Route::any('/frag-del/{id}', ['as' => 'admin.frag.del', 'uses' => 'ContentController@fragDel']);

        //管理员管理
        Route::get('/admins', ['as' => 'admin.admins', 'uses' => 'AdminController@adminsPage']);
        Route::any('/admins-edit/{id?}', ['as' => 'admin.admins.edit', 'uses' => 'AdminController@adminsEditPage']);
        Route::any('/admins-save/{id?}', ['as' => 'admin.admins.save', 'uses' => 'AdminController@adminsSave']);
        Route::any('/admins-del/{id?}', ['as' => 'admin.admins.del', 'uses' => 'AdminController@adminDel']);

        //日志记录
        Route::get('/logs/{index?}', ['as' => 'admin.logs', 'uses' => 'SettingController@logsPage']);
        Route::any('/logs-del/{id?}', ['as' => 'admin.logs.del', 'uses' => 'SettingController@logsDel']);

    });
});
